﻿// Copyright 2007-2008 Rory Plaire (codekaizen@gmail.com)

namespace NPack.Interfaces
{
    /// <summary>
    /// Every class that has a * operation and an element
    /// such that <code>x * e = e * x = x</code> for all x should consider implementing
    /// this interface.
    /// </summary>
    /// <typeparam name="T">Type which has multiplicative identity defined.</typeparam>
    /// <remarks>
    /// Adapted from an article on lambda-computing.com: 
    /// http://www.lambda-computing.com/publications/articles/generics/IArithmetic.cs.
    /// </remarks>
    public interface IHasOne<T> : IMultipliable<T>
    {
        /// <summary>
        /// Returns the multiplicative identity.
        /// </summary>
        /// <value>e</value>
        T One { get; }
    }
}
